package com.by_man.presenter.module_health_records.image;

import android.graphics.Bitmap;

import java.io.IOException;
import java.io.Serializable;

/**
 * 封装图像信息
 * Created by man on 2017-02-25.
 */
public class ImageInfo implements Serializable {
    public String imagePath;
    public Bitmap bitmap;
    public String thumbnailPath;

    public String getImagePath() {
        return imagePath;
    }

    public void setImagePath(String imagePath) {
        this.imagePath = imagePath;
    }

    public Bitmap getBitmap() {
        if (null == bitmap) {
            try {
                bitmap = BitmapManager.getLocalBitmap(imagePath);
            } catch (IOException ie) {
                ie.printStackTrace();
            }
        }
        return bitmap;
    }

    public void setBitmap(Bitmap bitmap) {
        this.bitmap = bitmap;
    }

    public String getThumbnailPath() {
        return thumbnailPath;
    }

    public void setThumbnailPath(String thumbnailPath) {
        this.thumbnailPath = thumbnailPath;
    }
}
